package cap4;

class TMinMax2 {
	//Atributos de instancia
	private float [] mm;
	//Constructor 
	public TMinMax2 (float mi,float ma){
	//Requiere ma >= mi
	  mm = new float [2];
	  mm[0] = mi;
	  mm[1] = ma;}
	//Comandos
	public void establecerMin(float m){
	  mm[0] = m;}
	public void establecerMax(float m){
	  mm[1] = m;}
	//Consultas
	public float obtenerMin(){
	  return mm[0];}
	public float obtenerMax(){
	  return mm[1];}
	public float promedio(){
	  return (mm[0]+mm[1])/2;}
	public float amplitudTermina(){
	  return mm[1]-mm[0];}
	public boolean equals(TMinMax r){
	  return mm[0] == r.obtenerMin() && 
	         mm[1] == r.obtenerMax();}
	}